package com.bitbakery.plugin.lisp.lang.formatting;

import com.intellij.formatting.Wrap;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class LispWrapProcessor {
    private static final Wrap WRAP_ALWAYS = Wrap.createWrap(Wrap.ALWAYS, true);
    private static final Wrap NO_WRAP = Wrap.createWrap(Wrap.NONE, true);

    /**
     * Calculates wrap between parent and child nodes
     *
     * @param parent      parent node
     * @param child       child node
     * @param childCount  Total count of parent children
     * @param childNumber The number of current child
     * @return wrap
     */
    @Nullable
    public static Wrap getChildWrap(@NotNull final LispBlock parent, @NotNull final ASTNode child,
                                    final int childCount, final int childNumber) {
        final PsiElement psiParent = parent.getNode().getPsi();
        final PsiElement psiChild = child.getPsi();

/*
        if (psiChild instanceof RNotWraped){
            return NO_WRAP;
        }


        if (psiChild instanceof RWrapedAlways){
            return WRAP_ALWAYS;
        }


        if (psiParent instanceof RWrapLastChild){
            if (childNumber == childCount-1){
                return WRAP_ALWAYS;
            }
        }

        if (psiParent instanceof RWrapCOMPSTMT){
            if (psiChild instanceof RCompoundStatement){
                return WRAP_ALWAYS;
            }
        }
*/

        return null;
    }
}
